<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libwebsockets: Context-and-vhost</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libwebsockets
   </div>
   <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__context-and-vhost.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#groups">Modules</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Context-and-vhost</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group__vhost-mounts"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__vhost-mounts.html">Vhost mounts and options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structlws__protocol__vhost__options.html">lws_protocol_vhost_options</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga41c2d763f78cc248df3b9f8645dbd2a5"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga41c2d763f78cc248df3b9f8645dbd2a5">lws_context_options</a> { <br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a>, 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a> = (1 &lt;&lt; 2), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a>, 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a> = (1 &lt;&lt; 4), 
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a> = (1 &lt;&lt; 5), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a> = (1 &lt;&lt; 6), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a> = (1 &lt;&lt; 7), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a> = (1 &lt;&lt; 8), 
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a>, 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a> = (1 &lt;&lt; 10), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a>, 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a> = (1 &lt;&lt; 12), 
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a> = (1 &lt;&lt; 13), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a> = (1 &lt;&lt; 14), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a> = (1 &lt;&lt; 15), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a> = (1 &lt;&lt; 16), 
<br />
&#160;&#160;<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a> = (1 &lt;&lt; 17), 
<a class="el" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a> = (1 &lt;&lt; 18)
<br />
 }</td></tr>
<tr class="separator:ga41c2d763f78cc248df3b9f8645dbd2a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaf2fff58562caab7510c41eeac85a8648"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_context *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context</a> (struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info)</td></tr>
<tr class="separator:gaf2fff58562caab7510c41eeac85a8648"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ee0314028755f1ddfa9428e09b4fddb"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga8ee0314028755f1ddfa9428e09b4fddb">lws_context_destroy</a> (struct lws_context *context)</td></tr>
<tr class="separator:ga8ee0314028755f1ddfa9428e09b4fddb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7e9d5405547a457d86e0b4f0ae2bb1c4"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga7e9d5405547a457d86e0b4f0ae2bb1c4">lws_set_proxy</a> (struct lws_vhost *vhost, const char *proxy)</td></tr>
<tr class="separator:ga7e9d5405547a457d86e0b4f0ae2bb1c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0c54c667ccd9b8b3dddcd123ca72f87c"><td class="memItemLeft" align="right" valign="top">LWS_EXTERN LWS_VISIBLE struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga0c54c667ccd9b8b3dddcd123ca72f87c">lws_create_vhost</a> (struct lws_context *context, struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info)</td></tr>
<tr class="separator:ga0c54c667ccd9b8b3dddcd123ca72f87c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98d88c9080fd89c37114363a6474ea73"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga98d88c9080fd89c37114363a6474ea73">lwsws_get_config_globals</a> (struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info, const char *d, char **config_strings, int *len)</td></tr>
<tr class="separator:ga98d88c9080fd89c37114363a6474ea73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga341064721add2618ae1b29717493a212"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga341064721add2618ae1b29717493a212">lwsws_get_config_vhosts</a> (struct lws_context *context, struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *info, const char *d, char **config_strings, int *len)</td></tr>
<tr class="separator:ga341064721add2618ae1b29717493a212"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8db03e19a372e34ac25cf21af894a02c"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga8db03e19a372e34ac25cf21af894a02c">lws_vhost_get</a> (struct lws *wsi) LWS_WARN_DEPRECATED</td></tr>
<tr class="separator:ga8db03e19a372e34ac25cf21af894a02c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06e77ce2916f8bc9826ef8d9d68e3932"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN struct lws_vhost *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost</a> (struct lws *wsi)</td></tr>
<tr class="separator:ga06e77ce2916f8bc9826ef8d9d68e3932"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94e6cc2223c4eec316b13bcebc3628b6"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#ga94e6cc2223c4eec316b13bcebc3628b6">lws_json_dump_vhost</a> (const struct lws_vhost *vh, char *buf, int len)</td></tr>
<tr class="separator:ga94e6cc2223c4eec316b13bcebc3628b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae2134657cdd2ea7a59e13ad314e4c50d"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#gae2134657cdd2ea7a59e13ad314e4c50d">lws_json_dump_context</a> (const struct lws_context *context, char *buf, int len)</td></tr>
<tr class="separator:gae2134657cdd2ea7a59e13ad314e4c50d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaeb12f934bfd178bd2132a9e73fc641da"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__context-and-vhost.html#gaeb12f934bfd178bd2132a9e73fc641da">lws_context_user</a> (struct lws_context *context)</td></tr>
<tr class="separator:gaeb12f934bfd178bd2132a9e73fc641da"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2>Context and Vhost releated functions</h2>
<p>LWS requires that there is one context, in which you may define multiple vhosts. Each vhost is a virtual host, with either its own listen port or sharing an existing one. Each vhost has its own SSL context that can be set up individually or left disabled.</p>
<p>If you don't care about multiple "site" support, you can ignore it and lws will create a single default vhost at context creation time. </p>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga41c2d763f78cc248df3b9f8645dbd2a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__context-and-vhost.html#ga41c2d763f78cc248df3b9f8645dbd2a5">lws_context_options</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p>enum lws_context_options - context and vhost options </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092"></a>LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT&#160;</td><td class="fielddoc">
<p>(VH) Don't allow the connection unless the client has a client cert that we recognize; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c"></a>LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME&#160;</td><td class="fielddoc">
<p>(CTX) Don't try to get the server's hostname </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d"></a>LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT&#160;</td><td class="fielddoc">
<p>(VH) Allow non-SSL (plaintext) connections on the same port as SSL is listening... undermines the security of SSL; provides LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6"></a>LWS_SERVER_OPTION_LIBEV&#160;</td><td class="fielddoc">
<p>(CTX) Use libev event loop </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9"></a>LWS_SERVER_OPTION_DISABLE_IPV6&#160;</td><td class="fielddoc">
<p>(VH) Disable IPV6 support </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93"></a>LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS&#160;</td><td class="fielddoc">
<p>(VH) Don't load OS CA certs, you will need to load your own CA cert(s) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc"></a>LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED&#160;</td><td class="fielddoc">
<p>(VH) Accept connections with no valid Cert (eg, selfsigned) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f"></a>LWS_SERVER_OPTION_VALIDATE_UTF8&#160;</td><td class="fielddoc">
<p>(VH) Check UT-8 correctness </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c"></a>LWS_SERVER_OPTION_SSL_ECDH&#160;</td><td class="fielddoc">
<p>(VH) initialize ECDH ciphers </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e"></a>LWS_SERVER_OPTION_LIBUV&#160;</td><td class="fielddoc">
<p>(CTX) Use libuv event loop </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada"></a>LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS&#160;</td><td class="fielddoc">
<p>(VH) Use http redirect to force http to https (deprecated: use mount redirection) </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a"></a>LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT&#160;</td><td class="fielddoc">
<p>(CTX) Initialize the SSL library at all </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e"></a>LWS_SERVER_OPTION_EXPLICIT_VHOSTS&#160;</td><td class="fielddoc">
<p>(CTX) Only create the context when calling context create api, implies user code will create its own vhosts </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941"></a>LWS_SERVER_OPTION_UNIX_SOCK&#160;</td><td class="fielddoc">
<p>(VH) Use Unix socket </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016"></a>LWS_SERVER_OPTION_STS&#160;</td><td class="fielddoc">
<p>(VH) Send Strict Transport Security header, making clients subsequently go to https even if user asked for http </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8"></a>LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY&#160;</td><td class="fielddoc">
<p>(VH) Enable LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE to take effect </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160"></a>LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE&#160;</td><td class="fielddoc">
<p>(VH) if set, only ipv6 allowed on the vhost </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd"></a>LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN&#160;</td><td class="fielddoc">
<p>(CTX) Libuv only: Do not spin on SIGSEGV / SIGFPE. A segfault normally makes the lib spin so you can attach a debugger to it even if it happened without a debugger in place. You can disable that by giving this option. </p>
</td></tr>
</table>
<div class="fragment"><div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160;                         {</div><div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a>     = (1 &lt;&lt; 1) |</div><div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;                                                                  (1 &lt;&lt; 12),</div><div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a>            = (1 &lt;&lt; 2),</div><div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a>             = (1 &lt;&lt; 3) |</div><div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;                                                                  (1 &lt;&lt; 12),</div><div class="line"><a name="l01506"></a><span class="lineno"> 1506</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a>                                 = (1 &lt;&lt; 4),</div><div class="line"><a name="l01508"></a><span class="lineno"> 1508</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a>                          = (1 &lt;&lt; 5),</div><div class="line"><a name="l01510"></a><span class="lineno"> 1510</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a>                   = (1 &lt;&lt; 6),</div><div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a>                = (1 &lt;&lt; 7),</div><div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a>                         = (1 &lt;&lt; 8),</div><div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a>                              = (1 &lt;&lt; 9) |</div><div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;                                                                  (1 &lt;&lt; 12),</div><div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a>                                 = (1 &lt;&lt; 10),</div><div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a>                = (1 &lt;&lt; 11) |</div><div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;                                                                  (1 &lt;&lt; 12),</div><div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a>                    = (1 &lt;&lt; 12),</div><div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a>                       = (1 &lt;&lt; 13),</div><div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a>                             = (1 &lt;&lt; 14),</div><div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a>                                   = (1 &lt;&lt; 15),</div><div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a>                    = (1 &lt;&lt; 16),</div><div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a>                     = (1 &lt;&lt; 17),</div><div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>&#160;        <a class="code" href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a>             = (1 &lt;&lt; 18),</div><div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>&#160;        <span class="comment">/****** add new things just above ---^ ******/</span></div><div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160;};</div><div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a274ed462a1a9239eb6ddf9007f5b7092">LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1494</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4933347a821e73c3f1e13fb6bfc7ad93">LWS_SERVER_OPTION_DISABLE_OS_CA_CERTS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1510</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a87a824b2e812f4c3e7f2c4a1ea4f8abd">LWS_SERVER_OPTION_UV_NO_SIGSEGV_SIGFPE_SPIN</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1540</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a4832187186c4d130c68051214cd42ada">LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1522</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5accc9d0d11d1124a21659586164b0962e">LWS_SERVER_OPTION_EXPLICIT_VHOSTS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1528</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a6582c985ee0ceaadc1d277030eae2d7c">LWS_SERVER_OPTION_SKIP_SERVER_CANONICAL_NAME</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1499</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1b2f8bde0f62adc7ebe81b2043f34c0c">LWS_SERVER_OPTION_SSL_ECDH</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1517</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a1cc4562d05cba52a6dfa0697a65ade0d">LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1501</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a273d9975675130de0c6dc937dde7c8a6">LWS_SERVER_OPTION_LIBEV</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1506</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a7fed6a527c8d5e0acac1b4179644583a">LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1526</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aca5d42820b65eac5618ec3f0bd8a1160">LWS_SERVER_OPTION_IPV6_V6ONLY_VALUE</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1538</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a34ab36e68c0d593b6f19b8d5ef1240a9">LWS_SERVER_OPTION_DISABLE_IPV6</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1508</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aff121db04a10cf8b2c5df9d4f2b89f1e">LWS_SERVER_OPTION_LIBUV</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1520</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5a9637e9001d8c8b2521086bcafbd8a941">LWS_SERVER_OPTION_UNIX_SOCK</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1531</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5aa0158b4e85420811e6b0f1378c6ded0f">LWS_SERVER_OPTION_VALIDATE_UTF8</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1515</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac56a8a6590e74a8016d0fae09fb404fc">LWS_SERVER_OPTION_PEER_CERT_NOT_REQUIRED</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1513</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5ac962efd35abf6c402f9fb14aa14f5016">LWS_SERVER_OPTION_STS</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1533</div></div>
<div class="ttc" id="group__context-and-vhost_html_gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8"><div class="ttname"><a href="group__context-and-vhost.html#gga41c2d763f78cc248df3b9f8645dbd2a5af62887536e25e053e68741006dba46d8">LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY</a></div><div class="ttdef"><b>Definition:</b> libwebsockets.h:1536</div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga8ee0314028755f1ddfa9428e09b4fddb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN void lws_context_destroy </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga8ee0314028755f1ddfa9428e09b4fddb">lws_context_destroy()</a> - Destroy the websocket context </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>Websocket context <pre class="fragment"> This function closes any active connections and then frees the
 context.  After calling this, any further use of the context is
 undefined.</pre> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaeb12f934bfd178bd2132a9e73fc641da"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN void* lws_context_user </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#gaeb12f934bfd178bd2132a9e73fc641da">lws_context_user()</a> - get the user data associated with the context </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>Websocket context</td></tr>
  </table>
  </dd>
</dl>
<p>This returns the optional user allocation that can be attached to the context the sockets live in at context_create time. It's a way to let all sockets serviced in the same context share data without using globals statics in the user code. </p>

</div>
</div>
<a class="anchor" id="gaf2fff58562caab7510c41eeac85a8648"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_context* lws_create_context </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
          <td class="paramname"><em>info</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> - Create the websocket handler </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>pointer to struct with parameters <pre class="fragment"> This function creates the listening socket (if serving) and takes care
 of all initialization in one step.

 If option LWS_SERVER_OPTION_EXPLICIT_VHOSTS is given, no vhost is
 created; you're expected to create your own vhosts afterwards using
 lws_create_vhost().  Otherwise a vhost named "default" is also created
 using the information in the vhost-related members, for compatibility.

 After initialization, it returns a struct lws_context * that
 represents this server.  After calling, user code needs to take care
 of calling lws_service() with the context pointer to get the
 server's sockets serviced.  This must be done in the same process
 context as the initialization call.

 The protocol callback functions are called for a handful of events
 including http requests coming in, websocket connections becoming
 established, and data arriving; it's also called periodically to allow
 async transmission.

 HTTP requests are sent always to the FIRST protocol in protocol, since
 at that time websocket protocol has not been negotiated.  Other
 protocols after the first one never see any HTTP callack activity.

 The server created is a simple http server by default; part of the
 websocket standard is upgrading this http connection to a websocket one.

 This allows the same server to provide files like scripts and favicon /
 images or whatever over http and dynamic data over websockets all in
 one place; they're all handled in the user callback.</pre> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga0c54c667ccd9b8b3dddcd123ca72f87c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_EXTERN LWS_VISIBLE struct lws_vhost* lws_create_vhost </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga0c54c667ccd9b8b3dddcd123ca72f87c">lws_create_vhost()</a> - Create a vhost (virtual server context) </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>pointer to result of <a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> </td></tr>
    <tr><td class="paramname">info</td><td>pointer to struct with parameters</td></tr>
  </table>
  </dd>
</dl>
<p>This function creates a virtual server (vhost) using the vhost-related members of the info struct. You can create many vhosts inside one context if you created the context with the option LWS_SERVER_OPTION_EXPLICIT_VHOSTS </p>

</div>
</div>
<a class="anchor" id="ga06e77ce2916f8bc9826ef8d9d68e3932"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_get_vhost </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost()</a> - return the vhost a wsi belongs to</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wsi</td><td>which connection </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gae2134657cdd2ea7a59e13ad314e4c50d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_json_dump_context </td>
          <td>(</td>
          <td class="paramtype">const struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#gae2134657cdd2ea7a59e13ad314e4c50d">lws_json_dump_context()</a> - describe context state and stats in JSON</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>the context </td></tr>
    <tr><td class="paramname">buf</td><td>buffer to fill with JSON </td></tr>
    <tr><td class="paramname">len</td><td>max length of buf </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga94e6cc2223c4eec316b13bcebc3628b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_json_dump_vhost </td>
          <td>(</td>
          <td class="paramtype">const struct lws_vhost *&#160;</td>
          <td class="paramname"><em>vh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga94e6cc2223c4eec316b13bcebc3628b6">lws_json_dump_vhost()</a> - describe vhost state and stats in JSON</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">vh</td><td>the vhost </td></tr>
    <tr><td class="paramname">buf</td><td>buffer to fill with JSON </td></tr>
    <tr><td class="paramname">len</td><td>max length of buf </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga7e9d5405547a457d86e0b4f0ae2bb1c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_set_proxy </td>
          <td>(</td>
          <td class="paramtype">struct lws_vhost *&#160;</td>
          <td class="paramname"><em>vhost</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>proxy</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga7e9d5405547a457d86e0b4f0ae2bb1c4">lws_set_proxy()</a> - Setups proxy to lws_context. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">vhost</td><td>pointer to struct lws_vhost you want set proxy for </td></tr>
    <tr><td class="paramname">proxy</td><td>pointer to c string containing proxy in format address:port</td></tr>
  </table>
  </dd>
</dl>
<p>Returns 0 if proxy string was parsed and proxy was setup. Returns -1 if proxy is NULL or has incorrect format.</p>
<p>This is only required if your OS does not provide the http_proxy environment variable (eg, OSX)</p>
<p>IMPORTANT! You should call this function right after creation of the lws_context and before call to connect. If you call this function after connect behavior is undefined. This function will override proxy settings made on lws_context creation with genenv() call. </p>

</div>
</div>
<a class="anchor" id="ga8db03e19a372e34ac25cf21af894a02c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN struct lws_vhost* lws_vhost_get </td>
          <td>(</td>
          <td class="paramtype">struct lws *&#160;</td>
          <td class="paramname"><em>wsi</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga8db03e19a372e34ac25cf21af894a02c">lws_vhost_get()</a> -</p><dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>deprecated: use <a class="el" href="group__context-and-vhost.html#ga06e77ce2916f8bc9826ef8d9d68e3932">lws_get_vhost()</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga98d88c9080fd89c37114363a6474ea73"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lwsws_get_config_globals </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>config_strings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga98d88c9080fd89c37114363a6474ea73">lwsws_get_config_globals()</a> - Parse a JSON server config file </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">info</td><td>pointer to struct with parameters </td></tr>
    <tr><td class="paramname">d</td><td>filepath of the config file </td></tr>
    <tr><td class="paramname">config_strings</td><td>storage for the config strings extracted from JSON, the pointer is incremented as strings are stored </td></tr>
    <tr><td class="paramname">len</td><td>pointer to the remaining length left in config_strings the value is decremented as strings are stored</td></tr>
  </table>
  </dd>
</dl>
<p>This function prepares a n <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> struct with global settings from a file d.</p>
<p>Requires CMake option LWS_WITH_LEJP_CONF to have been enabled </p>

</div>
</div>
<a class="anchor" id="ga341064721add2618ae1b29717493a212"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LWS_VISIBLE LWS_EXTERN int lwsws_get_config_vhosts </td>
          <td>(</td>
          <td class="paramtype">struct lws_context *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structlws__context__creation__info.html">lws_context_creation_info</a> *&#160;</td>
          <td class="paramname"><em>info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>d</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>config_strings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
<p><a class="el" href="group__context-and-vhost.html#ga341064721add2618ae1b29717493a212">lwsws_get_config_vhosts()</a> - Create vhosts from a JSON server config file </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>pointer to result of <a class="el" href="group__context-and-vhost.html#gaf2fff58562caab7510c41eeac85a8648">lws_create_context()</a> </td></tr>
    <tr><td class="paramname">info</td><td>pointer to struct with parameters </td></tr>
    <tr><td class="paramname">d</td><td>filepath of the config file </td></tr>
    <tr><td class="paramname">config_strings</td><td>storage for the config strings extracted from JSON, the pointer is incremented as strings are stored </td></tr>
    <tr><td class="paramname">len</td><td>pointer to the remaining length left in config_strings the value is decremented as strings are stored</td></tr>
  </table>
  </dd>
</dl>
<p>This function creates vhosts into a context according to the settings in JSON files found in directory d.</p>
<p>Requires CMake option LWS_WITH_LEJP_CONF to have been enabled </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
